#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int mod = 1e9 + 7;

int gcd(int a, int b)
{
    return b ? gcd(b, a % b) : a;
}

ll qmi(ll a, ll b)
{
    ll res = 1;
    while(b)
    {
        if(b & 1)res = res * a % mod;
        b >>= 1;
        a = a * a % mod;
    }
    return res;
}

void solve()
{
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i = 0; i < n; i++) cin >> a[i];
    sort(a.begin(), a.end());
    
    if(a[1] != a[0])
    {
        cout << "YES" << endl;
        return;
    }
    int t = 1;
    int i = 0, x = a[0];
    while(a[i] == a[i + 1]){
        t++;
        i++;
    }
    for(i = i + 1; i < n; i++)
    {
        if(a[i] % x != 0)
        {
            cout << "YES" << endl;
            return;
        }
    }
    cout << "NO" << endl;
}

int main()
{
    int t;
    cin >> t;
    while(t--) solve();
    return 0;
}